﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="firsteditpwd.aspx.cs" Inherits="PeisongWeb.admin.firsteditpwd" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register TagName="top1" Src="controls/top1.ascx" TagPrefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>修改密码 - 想购网长期采购物流配送系统</title>
    <!--#include file="style.inc"-->

    <script language="javascript" type="text/javascript">
        function scriptMethod() {
            Coolite.AjaxMethods.Customer_updatePwd({
                success: function(result) {
                    if (result == 0) {
                        Ext.Msg.alert("错误", "旧密码不正确，请重新输入！&nbsp;&nbsp;&nbsp;&nbsp;");
                        document.getElementById("txt_oldPassword").value = "";
                    }
                    else {
                        Ext.Msg.alert("成功", "恭喜您，您的密码修改成功！&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
                        document.getElementById("txt_oldPassword").value = "";
                        document.getElementById("txt_password").value = "";
                        document.getElementById("txt_password2").value = "";
                        window.location.href = 'index.html';
                    }
                }
            })
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <ext:ScriptManager ID="ScriptManager1" runat="server" />
    <uc1:top1 ID="Top1" runat="server" />
    <div id="admin_main" style="margin: 10px 0 0 10px;">
        <ext:Panel ID="Panel2" runat="server" Title="修改密码" BodyStyle="padding:5px 5px 0"
            Width="650" Frame="true" ButtonAlign="Center">
            <Body>
                <ext:Panel ID="Panel3" runat="server">
                    <Body>
                        <ext:ColumnLayout ID="ColumnLayout1" runat="server">
                            <ext:LayoutColumn ColumnWidth=".5">
                                <ext:Panel ID="Panel4" runat="server" Border="false" Header="false">
                                    <Body>
                                        <div id="admin_edit_content">
                                            <ul>
                                                <li>
                                                    *为了您的密码安全，请按照新的密码规则更改密码，谢谢合作！
                                                </li>
                                                <li>
                                                    <label>
                                                        旧密码：</label>
                                                    <asp:TextBox ID="txt_oldPassword" runat="server" TextMode="Password" MaxLength="50"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="请输入旧密码！"
                                                        ControlToValidate="txt_oldPassword" Display="Dynamic"></asp:RequiredFieldValidator>
                                                </li>
                                                <li>
                                                    <label>
                                                        新密码：</label>
                                                    <asp:TextBox ID="txt_password" runat="server" TextMode="Password" MaxLength="50"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="请输入新密码！"
                                                        ControlToValidate="txt_password" Display="Dynamic"></asp:RequiredFieldValidator>
                                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="txt_password"
                                                        ErrorMessage="密码应为6-14个字母加数字的形式" ValidationExpression="^(?![a-zA-Z]+$)(?![0-9]+$)[a-zA-Z0-9]{6,14}$" Display="Dynamic"></asp:RegularExpressionValidator>
                                                </li>
                                                <li>
                                                    <label>
                                                        确认密码：</label>
                                                    <asp:TextBox ID="txt_password2" runat="server" TextMode="Password" MaxLength="50"></asp:TextBox>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="请您再次输入新密码以确认！"
                                                        ControlToValidate="txt_password2" Display="Dynamic"></asp:RequiredFieldValidator>
                                                    <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="txt_password"
                                                        ControlToValidate="txt_password2" ErrorMessage="两次输入的密码不一样，请重输！" Display="Dynamic"></asp:CompareValidator>
                                                </li>
                                                <li>
                                                    <label>
                                                        &nbsp;</label>
                                                    <input id="btn_Submit" type="button" runat="server" value="保　存" onclick="if(Page_ClientValidate()) {return scriptMethod();} else{return false;}" />
                                                </li>
                                            </ul>
                                        </div>
                                    </Body>
                                </ext:Panel>
                            </ext:LayoutColumn>
                        </ext:ColumnLayout>
                    </Body>
                </ext:Panel>
            </Body>
        </ext:Panel>
    </div>
    </form>
</body>
</html>
